package com.elric.mall.consts;


import java.io.File;

/**
 * 代码生成配置
 */
public class GenConstant {

    /**
     * 路径分离（不通的机器，取不同的路径）
     */
    public static String FILE_SEP = File.separator;

    /**
     * 存放vm模板位置
     */
    public static String templatePath = "template" + FILE_SEP;

    /**
     * 代码生成路径
     */
    public static String indexPath;
    public static String servicePath;
    public static String fromPath;
    public static String importPath;
    public static String apiPath;

    /**
     * 各个代码存放路径文件夹
     */
    public static String[] xnCodeGenFilePath (String busName) {
        indexPath = busName + FILE_SEP;
        servicePath = busName + FILE_SEP;
        fromPath = busName + FILE_SEP + "components" + FILE_SEP;
        importPath = busName + FILE_SEP + "components" + FILE_SEP;
        apiPath = busName + FILE_SEP + "api" + FILE_SEP;
        return new String[] {
                indexPath, servicePath, fromPath, importPath, apiPath, apiPath, apiPath, apiPath
        };
    }

    /**
     * 模板文件
     */
    public static String[] xnCodeGenTempFile = {
            "index.tsx.vm",
            "service.ts.vm",
            "Form.tsx.vm",
            "Import.tsx.vm",
            "Controller.java.vm",
            "Service.java.vm",
            "ServiceImpl.java.vm",
            "Mapper.xml.vm",
    };
}
